package cn.dkk.create_design.prototype.projo;

import java.io.Serializable;

/**
 * 原型模式快速创建学生对象的案例
 */
public class Student implements Cloneable, Serializable {

    private SchoolClass schoolClass;

    private String studentName;

    public Student clone(String studentName) throws CloneNotSupportedException {
        Student student= (Student) super.clone();
        this.studentName=studentName;
        return student;
    }

    public Student(SchoolClass schoolClass, String studentName) {
        this.schoolClass = schoolClass;
        this.studentName = studentName;
    }

    public SchoolClass getSchoolClass() {
        return schoolClass;
    }

    public void setSchoolClass(SchoolClass schoolClass) {
        this.schoolClass = schoolClass;
    }

    public String getStudentName() {
        return studentName;
    }

    public void setStudentName(String studentName) {
        this.studentName = studentName;
    }
}
